import urllib.request

# 下载网页
url_page = "http://www.baidu.com"
urllib.request.urlretrieve(url_page, "baidu.html")

# 下载图片
url_img = "http://img0.bdstatic.com/img/image/wise/1%E6%B8%85%E7%BA%AF%E7%BE%8E%E5%A5%B3.jpg"
urllib.request.urlretrieve(url=url_img, filename="1.jpg")

# 下载视频
url_video = "https://vd3.bdstatic.com/mda-mifkzasfkdrfi7ut/540p/h264_cae/1631803715339182936/mda-mifkzasfkdrfi7ut.mp4?v_from_s=hkapp-haokan-tucheng&auth_key=1631935289-0-0-63b5d1a51614207c1e3ceaf14a4d1879&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest="
urllib.request.urlretrieve(url_video, "1.mp4")